home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / c / cp1.zip / PM1.C < prev    next >
Text File  |  1993-05-18  |  3KB  |  83 lines

  1. ===========================================================================
  2.  BBS: The Abacus * HST/DS * Potterville, MI
  3. Date: 05-15-93 (17:04)             Number: 129
  4. From: DANNY MATHEWS                Refer#: NONE
  5.   To: ALL                           Recvd: NO  
  6. Subj: <string.h>   1/2               Conf: (36) C Language
  7. ---------------------------------------------------------------------------
  8.  I wrote a program(pm.c) that generates a text report on equipment that is due
  9.  for preventative maintanance.  What the program does is read from a file
  10.  misti.dat to get the mach/entity status.  Then it reads from a file called
  11.  module.dat to see if the mach/entity is in the list; if so, get a description
  12.  of the machine. My problem started when I tried to add a date function. That
  13.  is when I noticed I was using some string functions in the program pm.c but
  14.  had not included <string.h>. Do I need <string.h>?
  15.  
  16.                   r = strcmp(entity,mach);
  17.  
  18.                   if (r == 0)  {
  19.                         len = strxfrm(target,descript,30);
  20.                         strxfrm(target,descript,len);
  21.                         fprintf(fout," %-7s %-25s %5s     %-13s %7s"
  22.                               ,mach,target,state,pm,pm_date);
  23.                         fprintf(fout,"\n");
  24.  
  25.  
  26.  Now r = -29 instead of r = 0 when using <string.h>.
  27.  A sample of the text files and source code I was using for debugging
  28.  follows.
  29.  
  30.  I am still tying to figure it out. Do I leave <sting.h> out?
  31.  
  32.  The program, with the date functions work fine without <string.h>?????
  33.  
  34.  Any help, hints and constructive criticism would be appreciated.
  35.  
  36.  danny
  37.  
  38.  misti.dat
  39.  AD101   16    931110  Annual
  40.  AD101   16    930511  Semi-Annual
  41.  AD101   16    930722  Quarterly
  42.  WS101   16    940118  Annual
  43.  WS101   16    930717  Semi-Annual
  44.  WS101   16    930726  Quarterly
  45.  WS101   16    930527  Monthly
  46.  WG302   00    940228  Annual
  47.  WG302   00    930829  Semi-Annual
  48.  WG302   00    930531  Quarterly
  49.  WO302   16    940301  Annual
  50.  WO302   16    930830  Semi-Annual
  51.  WO302   16    930601  Quarterly
  52.  
  53.  module.dat
  54.  AD101  GATE CLEAN
  55.  WS101  GATE HOOD
  56.  WG101  SMS GATE HOOD
  57.  WG302  SMS GATE HOOD
  58.  WG303  SMS GATE HOOD
  59.  WO101  SMS OZONE HOOD
  60.  WO302  SMS OZONE HOOD
  61.  WO303  SMS OZONE HOOD
  62.  WO304  SMS OZONE HOOD
  63.  
  64.  pm.rpt(output file)
  65.   AD101   GATE CLEAN                   16     Annual         931110
  66.   AD101   GATE CLEAN                   16     Semi-Annual    930511
  67.   AD101   GATE CLEAN                   16     Quarterly      930722
  68.    ...
  69.    ...
  70.  
  71.   WS101   GATE HOOD                    16     Annual         940118
  72.   WS101   GATE HOOD                    16     Quarterly      930601
  73.   WS101   GATE HOOD                    16     Quarterly      930601
  74.   (continued in next message)
  75.  
  76. ... OFFLINE 1.52  "IF %COMMERCIAL == BLADDER.FUL GOTO BATHROOM.NOW"
  77.  
  78. --- Maximus 2.01wb
  79.  * Origin: The MOCHINE BBS * Irving, TX * 214/399-8414 * HST DS *  (1:124/1301)
  80. SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1
  81. SEEN-BY: 153/752 154/40 77 157/2 159/100 125 575 950 203/23 209/209 261/1023
  82. SEEN-BY: 280/1 390/1 396/1 5 15 2270/1 2440/5 3603/20
  83.